/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.brain.service;

import java.util.List;

import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.brain.entity.BUserRankData;
import com.thinkgem.jeesite.modules.brain.dao.BUserRankDataDao;

/**
 * 用户排位数据Service
 * @author 程展峰
 * @version 2021-09-18
 */
@Service
@Transactional(readOnly = true)
public class BUserRankDataService extends CrudService<BUserRankDataDao, BUserRankData> {

	public BUserRankData get(String id) {
		return super.get(id);
	}
	
	public List<BUserRankData> findList(BUserRankData bUserRankData) {
		return super.findList(bUserRankData);
	}
	
	public Page<BUserRankData> findPage(Page<BUserRankData> page, BUserRankData bUserRankData) {
		return super.findPage(page, bUserRankData);
	}
	
	@Transactional(readOnly = false)
	public void save(BUserRankData bUserRankData) {
		super.save(bUserRankData);
	}
	
	@Transactional(readOnly = false)
	public void delete(BUserRankData bUserRankData) {
		super.delete(bUserRankData);
	}

	public List<BUserRankData> findHundredRank(BUserRankData m){
		return dao.findHundredRank(m);
	}

	public int updateCurrStar(int count){

		return  super.dao.updateCurrStar(UserUtils.getUser().getId(),count);

	}
	public Page<BUserRankData> findHundredRankPage(Page<BUserRankData> page,BUserRankData m){
		m.setPage(page);
		page.setList(dao.findList(m));
		return page;
	}
	public BUserRankData getCurrRank(BUserRankData m){

		return super.dao.getCurrRank(m);
	}
}